package com.itheima.chapter10.blockQueue;

import java.util.concurrent.ArrayBlockingQueue;

public class Consumer extends Thread{
    private ArrayBlockingQueue<String> abq;

    public Consumer(ArrayBlockingQueue<String> abq) {
        this.abq=abq;
    }

    @Override
    public void run() {
        while (true) {
            try {
                String take = abq.take();
                System.out.println("消费者000 "+take);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }


    }
}
